<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
    String queryString = request.getQueryString() == null ? "" : request.getQueryString().replaceAll("(\\&?lang\\=[a-zA-Z]{2}\\_[a-zA-Z]{2})|(lang\\=[a-zA-Z]{2}\\_[a-zA-Z]{2}\\&?)", "");
    String lang = request.getParameter("lang");
    String hspId = request.getParameter("hospitalId");
    if (lang != null) {
        session.setAttribute("locale", lang);
    } else if (session.getAttribute("locale") == null){
        session.setAttribute("locale", request.getLocale().toString());
    }
%>
<!DOCTYPE html>
<html lang="zh">
<c:if test="${'zh_CN'.equals(sessionScope.locale)}">
    <fmt:setLocale value="zh_CN"/>
</c:if>
<c:if test="${sessionScope.locale.indexOf('en') != -1}">
    <fmt:setLocale value="en_US"/>
</c:if>
<fmt:setBundle basename="charts" var="charts" />
<fmt:bundle basename="charts">
<head>
    <meta charset="utf-8"/>
        <%-- rem.js --%>
    <script src="<%=basePath%>/js/rem.js"></script>
    <title>医疗设备系统</title>
    <link rel="shortcut icon" href="<%=basePath%>/images/favicon.ico">
    <link href="<%=basePath%>/plugins/charts/css/global.css" rel="stylesheet"/>
    <link rel="stylesheet" href="<%=basePath%>/css/font-awesome.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iziModal/css/iziModal.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/select2/select2.min.css">
    <link rel="stylesheet" href="<%=basePath%>/plugins/iCheck/all.css">
    <link href="<%=basePath%>/plugins/charts/css/style.css" rel="stylesheet"/>
    <link href="<%=basePath%>/plugins/charts/css/select2-my.css" rel="stylesheet"/>
    <link rel="stylesheet" href="<%=basePath%>/plugins/flavr/flavr.css">
</head>
<body>
<div id="container">
    <%--顶部选项--%>
    <div class="head-container">
        <div class="head">
            <div class="fl global_area">
                <i class="fa fa-arrow-left fl" onclick="javascript:history.go(-1);"></i>
                <div class="fl" id="language">
                    <div class="language">
                        <c:choose>
                            <c:when test="${'zh_CN'.equals(sessionScope.locale)}">简体中文</c:when>
                            <c:when test="${sessionScope.locale.indexOf('en') != -1}">English</c:when>
                            <c:otherwise>简体中文</c:otherwise>
                        </c:choose>
                    </div>
                    <ul class="hide">
                        <li><a href="?<%=queryString%>&lang=zh_CN">简体中文</a></li>
                        <li><a href="?<%=queryString%>&lang=en_US">English</a></li>
                    </ul>
                </div>
                <ul class="global">
                    <li><a id="btn1"><fmt:message key="share.title.zl"/></a></li>
                    <li><a id="btn2" class="on"><span class="page" page-hospital="department-index"><fmt:message key="share.title.fx"/></span>-<span class="page" page-hospital="model-index"><fmt:message key="share.title.sbxh"/></span></a></li>
                    <li><a id="btn5"><img src="<%=basePath%>/plugins/charts/images/search.png"></a></li>
                    <li><a id="btn6" onclick="reset()"><img src="<%=basePath%>/plugins/charts/images/reset.png"></a></li>
                    <li><a id="btn7" onclick="logout()" title="<fmt:message key="share.title.tcdl"/>"><img src="<%=basePath%>/plugins/charts/images/logout.png"></a></li>
                </ul>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <%--筛选条件--%>
        <jsp:include page="choose.jsp"></jsp:include>

    <div class="content" style="display:flex;flex-direction:column;justify-content:flex-start;">
        <%-- 总量统计 --%>
        <div class="totle">
            <%-- 设备类型 --%>
            <div class="frame frame1" style="width:24%;">
                <div class="border">
                    <div class="detail fl">
                        <p class="title"><img src="<%=basePath%>/plugins/charts/images/totle.png"
                                              width="15"/><em class="spanTitle active" id="title1"><fmt:message key="index.overview.sbxh.pjnxzs"/></em><span
                                id="yoy0" style="font-size:12px;color:#e68b36;text-decoration:none;"></span></p>
                        <p class="sum"><fmt:message key="index.overview.sbxh.nxzs"/>：<em id="count1-1"></em></p>
                        <p class="range"><fmt:message key="share.overview.kssl"/>：<span id="yoy1-1"></span> <fmt:message key="share.unit.ge"/></p>
                    </div>
                    <div class="chart fr chart-text">
                        <p class="sum"><fmt:message key="index.overview.sblx.sbsl"/>：<em id="count1-2"></em><fmt:message key="share.unit.tai"/></p>
                        <p class="range"><fmt:message key="share.overview.tb"/>：<span id="yoy1-2" class="yoy"></span></p>
                        <p class="line"></p>
                        <p class="sum"><fmt:message key="share.overview.sbje"/>：<em id="count1-3"></em> <fmt:message key="share.unit.wanyuan"/></p>
                        <p class="sum"><fmt:message key="share.overview.tb"/>：<em id="count1-4" class="yoy"></em></p>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            <%-- >500万设备 --%>
            <div class="frame" style="width:23%;">
                <div class="border">
                    <div class="detail fl">
                        <p class="title">
                            <em class="spanTitle" id="title2"><fmt:message key="index.overview.sbxh.nxzs"/>≥1</em>
                        </p>
                        <p class="sum"><fmt:message key="index.overview.sbxh.nxzs"/>：<em id="count2-1"></em></p>
                        <p class="range"><fmt:message key="share.overview.kssl"/>：<span id="yoy2-1"></span> <fmt:message key="share.unit.ge"/></p>
                    </div>
                    <div class="chart fr chart-text">
                        <p class="sum"><fmt:message key="index.overview.sblx.sbsl"/>：<em id="count2-2"></em><fmt:message key="share.unit.tai"/></p>
                        <p class="range"><fmt:message key="share.overview.tb"/>：<span id="yoy2-2" class="yoy"></span></p>
                        <p class="line"></p>
                        <p class="sum"><fmt:message key="share.overview.sbje"/>：<em id="count2-3"></em> <fmt:message key="share.unit.wanyuan"/></p>
                        <p class="sum"><fmt:message key="share.overview.tb"/>：<em id="count2-4" class="yoy"></em></p>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            <%-- 100-500万设备 --%>
            <div class="frame" style="width:23%;">
                <div class="border">
                    <div class="detail fl">
                        <p class="title"><em class="spanTitle" id="title3"><fmt:message key="index.overview.sbxh.nxzs"/>0.7-1</em></p>
                        <p class="sum"><fmt:message key="index.overview.sbxh.nxzs"/>：<em id="count3-1"></em></p>
                        <p class="range"><fmt:message key="share.overview.kssl"/>：<span id="yoy3-1"></span> <fmt:message key="share.unit.ge"/></p>
                    </div>
                    <div class="chart fr chart-text">
                        <p class="sum"><fmt:message key="index.overview.sblx.sbsl"/>：<em id="count3-2"></em><fmt:message key="share.unit.tai"/></p>
                        <p class="range"><fmt:message key="share.overview.tb"/>：<span id="yoy3-2" class="yoy"></span></p>
                        <p class="line"></p>
                        <p class="sum"><fmt:message key="share.overview.sbje"/>：<em id="count3-3"></em> <fmt:message key="share.unit.wanyuan"/></p>
                        <p class="sum"><fmt:message key="share.overview.tb"/>：<em id="count3-4" class="yoy"></em></p>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            <%-- <100万设备 --%>
            <div class="frame" style="width:23%;">
                <div class="border">
                    <div class="detail fl">
                        <p class="title"><em class="spanTitle" id="title4"><fmt:message key="index.overview.sbxh.nxzs"/><0.7</em></p>
                        <p class="sum"><fmt:message key="index.overview.sbxh.nxzs"/>：<em id="count4-1"></em></p>
                        <p class="range"><fmt:message key="share.overview.kssl"/>：<span id="yoy4-1"></span> <fmt:message key="share.unit.ge"/></p>
                    </div>
                    <div class="chart fr chart-text">
                        <p class="sum"><fmt:message key="index.overview.sblx.sbsl"/>：<em id="count4-2"></em><fmt:message key="share.unit.tai"/></p>
                        <p class="range"><fmt:message key="share.overview.tb"/>：<span id="yoy4-2" class="yoy"></span></p>
                        <p class="line"></p>
                        <p class="sum"><fmt:message key="share.overview.sbje"/>：<em id="count4-3"></em> <fmt:message key="share.unit.wanyuan"/></p>
                        <p class="sum"><fmt:message key="share.overview.tb"/>：<em id="count4-4" class="yoy"></em></p>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
        </div>


        <%--图表和排名--%>
        <div class="bottom_bar" style="flex:1;">
            <%--左边部分--%>
            <div class="list_area fl">
                <%--图表--%>
                <div class="border chart-border">
                    <div class="area" style="position:relative;">
                        <p class="title">
                            <span class="fl"><span class="fb spanTitle" id="moredetail"><fmt:message key="charts.title.sbxhfb"/></span></span>
                        </p>
                        <p class="fr title quadrantContainner">
                            <span class="quadrantName"><fmt:message key="charts.button.xx" />：</span>
                            <span class="quadrant quadrant1">1</span>
                            <span class="quadrant quadrant2">2</span>
                            <span class="quadrant quadrant3">3</span>
                            <span class="quadrant quadrant4">4</span>
                        </p>
                        <div id="swiper">
                            <div class="swiper-container">
                                <div class="slide home-device">
                                    <div class="chartArea" id="chart" style="height:100%;"></div>

                                    <input id="currentTag" style="display:none;" value="tendency"/>
                                    <div class="pagination pagination1"></div>
                                </div>
                            </div>
                            <%--<span class="btn btn-left">&lt;</span>
                            <span class="btn btn-right">&gt;</span>--%>
                            <div class="option-page">
                                <a href="<%=basePath%>/charts/hospital/model-cost/page?hospitalId=<%=hspId%>"><span
                                        class="option option_cost"><fmt:message key="share.title.yyxl"/></span></a>
                                <a
                                        href="<%=basePath%>/charts/hospital/model-maintain/page?hospitalId=<%=hspId%>"><span class="option option_maintain"><fmt:message key="share.title.wxqk"/></span></a>
                                <a
                                        href="<%=basePath%>/charts/hospital/model-maintenance/page?hospitalId=<%=hspId%>"><span class="option option_maintenance"><fmt:message key="share.title.whqk"/></span></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <%--左边结束--%>

            <%--右侧排名--%>
            <div class="list_data fr">
                <div class="border">
                    <div class="area">
                        <div class="data_detail">
                            <div id="top5_hospital" class="top5">
                                <p class="title">
                                    <img src="<%=basePath%>/plugins/charts/images/yljg.png">
                                    <em id="morehospitals" class="spanTitle"><fmt:message key="share.table.head.yyks"/></em>
                                    <span>TOP5</span>
                                </p>
                                <p class="name"><span class="fl data_span_f"><fmt:message key="share.table.head.yyks"/></span><span
                                        class="fl listpercent data_span_s"><fmt:message key="index.table.nxzs"/></span><span
                                        class="fr listcontent"><fmt:message key="index.table.sbje(wy)"/></span></p>
                                <ul class="hospital" id="ul_hospital"></ul>
                            </div>
                            <div id="top5_type" class="top5">
                                <p class="title">
                                    <img src="<%=basePath%>/plugins/charts/images/sblx.png">
                                    <em id="moretypes" class="spanTitle"><fmt:message key="share.table.head.sbxh"/></em>
                                    <span>TOP5</span></p>
                                <p class="name">
                                    <span class="fl data_span_f"><fmt:message key="share.table.head.sbxh"/></span>
                                    <span class="fl listpercent data_span_s"><fmt:message key="index.table.nxzs"/></span>
                                    <span class="fr listcontent"><fmt:message key="index.table.sbje(wy)"/></span>
                                </p>
                                <ul class="hospital" id="ul_type"></ul>
                            </div>
                            <div id="top5_brand" class="top5">
                                <p class="title">
                                    <img src="<%=basePath%>/plugins/charts/images/sblx.png">
                                    <em id="morebrand" class="spanTitle"><fmt:message key="share.table.head.sbcj"/></em>
                                    <span>TOP5</span></p>
                                <p class="name">
                                    <span class="fl data_span_f"><fmt:message key="share.table.head.sbcj"/></span>
                                    <span class="fl listpercent data_span_s"><fmt:message key="index.table.nxzs"/></span>
                                    <span class="fr listcontent"><fmt:message key="index.table.sbje(wy)"/></span>
                                </p>
                                <ul class="hospital" id="ul_brand"></ul>
                            </div>

                            <div id="top5_year" class="top5" style="display:none;">
                                <p class="title">
                                    <em id="moreyears" class="spanTitle"><fmt:message key="charts.button.lnsj"/></em>
                                <p class="name">
                                    <span class="fl data_span_f"><fmt:message key="share.table.head.nf"/></span>
                                    <span class="fl listpercent data_span_s"></span>
                                    <span class="fr listcontent"><fmt:message key="index.table.sbje(wy)"/></span>
                                </p>
                                <ul class="hospital" id="ul_year"></ul>
                            </div>
                            <div id="top5_device" class="top5">
                                <p class="title">
                                    <em id="moredevices" class="spanTitle"><fmt:message key="share.table.head.jtsb"/></em>
                                    <span>TOP5</span></p>
                                <p class="name">
                                    <span class="fl data_span_f"><fmt:message key="share.table.head.sbmc"/></span>
                                    <span class="fl listpercent data_span_s"><fmt:message key="index.table.zb"/>(%)</span>
                                    <span class="fr listcontent"><fmt:message key="index.table.sbje(wy)"/></span>
                                </p>
                                <ul class="hospital" id="ul_device"></ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <%--右侧结束--%>
        </div>
    </div>
    <div class="baseline"></div>
    <%--详情图表模态框--%>
    <div id="modal" style="display:none">
        <div class="row">
            <div class="col-md-12">
                <div class="box-body no-padding">
                    <table id="tblSort" class="table table-bordered table-striped table-hover table-responsive">
                        <tbody id="table_data">
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<%-- JS部分 --%>
<script src="<%=basePath%>/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="<%=basePath%>/plugins/jQuery/jquery.cookie.js"></script>
<script src="<%=basePath%>/plugins/fastclick/fastclick_1.0.6.min.js"></script>
<script src="<%=basePath%>/plugins/flavr/flavr.min.js"></script>
<script src="<%=basePath%>/plugins/charts/js/echarts.min.js"></script>
<!-- 引入 macarons 主题 -->
<script src="<%=basePath%>/echarts/customed.js"></script>
<script src="<%=basePath%>/plugins/select2/select2.full.min.js"></script>
<script src="<%=basePath%>/plugins/select2/i18n/zh-CN.js"></script>
<script src="<%=basePath%>/plugins/iziModal/js/iziModal.min.js"></script>
<script src="<%=basePath%>/plugins/iCheck/icheck.min.js"></script>
<script src="<%=basePath%>/plugins/charts/js/plugins.js"></script>
<script src="<%=basePath%>/plugins/charts/js/tableHeadFixer.js"></script>
<script>
    /*--------- 全局变量 ---------*/
    var CONST = 1000000;
    var modelName = '';
    var basePath = '<%=basePath%>';
    var typeid = window.location.search.split('=')[1] || '';
    /*--------- 全局变量 ---------*/

    /* 页面初始化 */
    $(function () {
        loading(function () {
            addChooseRadioEvent('hospital');
            resizeWindow();
            initChart();  // 初始化图表
            ChooseBox.siblingsClick();
            querySearch("department", '');
            querySearch("risk", '');
            querySearch("type", '');
            querySearch("brand", '');
            querySearch("year", '');
            getParams();
            appendTime();
            clickChange($('.detail .title em'));
            clickToggle($('.quadrant'));
            $("#btn5").click(function () {
                ChooseBox.toggle();
            });
        });
    });

    // 初始化图表并添加图表点击事件
    function initChart() {
        chart = echarts.init(document.getElementById('chart'), 'customed');  // 初始化echarts实例
        chart.on("click", click);
    }

    // #title1
    $('#title1').click(function(){
        $('#ageLimitStart').val('');
        $('#ageLimitEnd').val('');
        getParams();
    });
    // #title2
    $('#title2').click(function(){
        $('#ageLimitStart').val(ageLimitMax);
        $('#ageLimitEnd').val('');
        getParams();
    });
    // #title3
    $('#title3').click(function(){
        $('#ageLimitStart').val(ageLimitMin);
        $('#ageLimitEnd').val(ageLimitMax);
        getParams();
    });
    // #title4
    $('#title4').click(function(){
        $('#ageLimitStart').val('');
        $('#ageLimitEnd').val(ageLimitMin);
        getParams();
    });

    var queryStatus = {
        arr: ['hospital', 'model', 'brand', 'assets'],
        getStatus: function () {
            for (var i = 0; i < this.arr.length; i++) {
                if (!this[this.arr[i]]) return false;
            }
            return true;
        },
        resetStatus: function () {
            for (var i = 0; i < this.arr.length; i++) {
                this[this.arr[i]] = false;
            }
        }
    };
    function click(param) {
        if (typeof param.seriesIndex === 'undefined') {
            return;
        }
        if (param.componentType === 'markLine') {
            return;
        }
        loading();
        if (param.type === 'click') {
            var index = param.dataIndex;
            var tab = false;
            if (modelName == idsType[index]) {
                modelName = '';
                tab = false;
                index = 0;
            } else {
                modelName = idsType[index];
                tab = true;
            }
            setUlType('desc', index, tab);
            queryStatus.model = true;
            queryChartsData();
            queryBrandTop5Data();
            queryDeviceTop5Data();
        }
    }

    //查询筛选条件
    var typeIdArr;
    function querySearch(tag, tagId) {
        var url = "<%=basePath%>/hospital/search/" + tag;
        $.ajax({
            type: "POST",
            data: {
              hospitalId: hspId},
            url: url,
            dataType: "json",
            async: false,
            success: function (data) {
                if (data.ret === 1) {
                    data.data = data.data || {list:[]};
                    var searchData = data.data;
                    setSearch(tag, searchData);
                    $('.select_' + (tag == 'department' ? 'hospital' : tag)).select2({
                        placeholder:'<fmt:message key="share.sift.qxz"/>',
                        allowClear:true
                    });
                    ChooseBox.setSearchFromCookie(tag);
                    if(tag == 'type') {
                        searchDataGlobal = searchData;
                        $('.select_type').on('select2:select', function (param) {
                            typeIdArr =  $('.select_type').val();
                            var id = param.params.data.id;
                            if(id < 2016102346) {
                                for (var i = 0; i < searchDataGlobal[id].length; i++) {
                                    typeIdArr.push(searchDataGlobal[id][i].id)
                                }
                            }
                            $('.select_type').val(typeIdArr).trigger('change');
                        });
                        $('.select_type').on('select2:unselect', function (param) {
                            typeIdArr =  $('.select_type').val();
                            var id = param.params.data.id;
                            typeIdArr.removeByValue(id);
                            if(id < 2016102346) {
                                for (var i = 0; i < searchDataGlobal[id].length; i++) {
                                    typeIdArr.removeByValue(searchDataGlobal[id][i].id)
                                }
                            }
                            $('.select_type').val(typeIdArr).trigger('change');
                        });
                    }
                    if(tag == 'type' && window.location.search.split('=')[1]){
                        typeId = GetQueryString('typeId') ? [GetQueryString('typeId')] : '';
                        $('.select_type').val(typeId).trigger('change');
                    }
                } else {
                    if (data.msg == '该用户不存在') {
                        location.href = '<%=basePath%>';
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                }
            },
            failure: function () {
                flavrShowByTime(data.msg, null, "danger", false);
            }
        })
    }
    /* 设置搜索框搜索条件 */
    function setSearch(tag, data) {
        var first, second, id, str, str1;
        if (tag === "type") {
            str = '';
            first = data.first;
            for(var i = 0; i < first.length; i++){
                //一级设备
                if('${sessionScope.locale}'.indexOf('en') != -1) {
                    str += '<optgroup label="' + (first[i].enName || "") + '">' +
                        (function () {
                            str1 = '';
                            id = first[i].id;
                            if (data[id]) {
                                //一级设备
                                str1 = '<option value="' + first[i].id + '">' + (first[i].enName || "") + '</option>';
                                second = data[id];
                                for (var j = 0; j < second.length; j++) {
                                    //二级设备
                                    str1 += '<option value="' + second[j].id + '">' + (second[j].enName || "") + '</option>';
                                }
                            } else {
                                str1 = '<option value="' + first[i].id + '">' + (first[i].enName || "") + '</option>';
                            }
                            return str1;
                        })() +
                        '</optgroup>';
                } else {
                    str += '<optgroup label="' + (first[i].name || "") + '">' +
                        (function () {
                            str1 = '';
                            id = first[i].id;
                            if (data[id]) {
                                //一级设备
                                str1 = '<option value="' + first[i].id + '">' + (first[i].name || "") + '</option>';
                                second = data[id];
                                for (var j = 0; j < second.length; j++) {
                                    //二级设备
                                    str1 += '<option value="' + second[j].id + '">' + (second[j].name || "") + '</option>';
                                }
                            } else {
                                str1 = '<option value="' + first[i].id + '">' + (first[i].name || "") + '</option>';
                            }
                            return str1;
                        })() +
                        '</optgroup>';
                }
            }
            $(".select_type").append(str);
        } else {
            data = data.list;
            if (tag == 'department') {
                if('${sessionScope.locale}'.indexOf('en') != -1) {
                    for (var i = 0; i < data.length; i++) {
                        $(".select_" + 'hospital').append('<option value="' + data[i].id + '">' + (data[i].enName || "") + '</option>');
                    }
                } else {
                    for (var i = 0; i < data.length; i++) {
                        $(".select_" + 'hospital').append('<option value="' + data[i].id + '">' + (data[i].name || "") + '</option>');
                    }
                }
            } else {
                if('${sessionScope.locale}'.indexOf('en') != -1) {
                    for (var i = 0; i < data.length; i++) {
                        $(".select_" + tag).append('<option value="' + data[i].id + '">' + (data[i].enName || "") + '</option>');
                    }
                } else {
                    for (var i = 0; i < data.length; i++) {
                        $(".select_" + tag).append('<option value="' + data[i].id + '">' + (data[i].name || "") + '</option>');
                    }
                }
            }
        }

    }

    //全市详情
    function queryAllAssets() {
        $.ajax({
            type: "POST",
            url: "<%=basePath%>/charts/hospital/model-index/overview",
            async: false,
            data: {
              hospitalId: hspId,
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                riskId: riskId ? JSON.stringify(riskId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                brandId: brandId ? JSON.stringify(brandId) : '',
                year: year ? JSON.stringify(year) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                agelimitStart: ageLimitStart,
                agelimitEnd: ageLimitEnd
            },
            dataType: "json",
            success: function (data) {
                if(data.ret == 1){
                    data.data = data.data || {list:[]};
                    data = data.data;
                    assets = data;
                    ageLimitMax = data.ageLimitList[0].name;
                    ageLimitMin = data.ageLimitList[2].name;
                    $('#title2').html('<fmt:message key="index.overview.sbxh.nxzs"/>≥' + ageLimitMax);
                    $('#title3').html('<fmt:message key="index.overview.sbxh.nxzs"/>' + ageLimitMin + '-' + ageLimitMax);
                    $('#title4').html('<fmt:message key="index.overview.sbxh.nxzs"/><' + ageLimitMin);

                    // 年限指数 及 医院数量
                    $('#count1-1').html(parseFloat(data.allAssets.curAgeLimitMeasure || 0).toFixed(2));
                    $('#yoy1-1').html(data.allAssets.hospitalCounts || 0);
                    // 设备数量 及 同比
                    $('#count1-2').html(data.allAssets.curCounts || 0);
                    $('#yoy1-2').html(parseFloat((data.allAssets.deviceCountsYoy) || 0).toFixed(2) + '%');
                    // 设备金额 及 同比
                    $('#count1-3').html(parseFloat((data.allAssets.curPrice / (CONST)) || 0).toFixed(2));
                    $('#count1-4').html(parseFloat((data.allAssets.devicePriceYoy) || 0).toFixed(2) + '%');

                    // 年限指数 及 医院数量
                    $('#count2-1').html(parseFloat(data.ageLimitList[0].curAgeLimitMeasure || 0).toFixed(2));
                    $('#yoy2-1').html(data.ageLimitList[0].hospitalCounts || 0);
                    // 设备数量 及 同比
                    $('#count2-2').html(data.ageLimitList[0].curCounts || 0);
                    $('#yoy2-2').html(parseFloat((data.ageLimitList[0].deviceCountsYoy) || 0).toFixed(2) + '%');
                    // 设备金额 及 同比
                    $('#count2-3').html(parseFloat((data.ageLimitList[0].curPrice / (CONST)) || 0).toFixed(2));
                    $('#count2-4').html(parseFloat((data.ageLimitList[0].devicePriceYoy) || 0).toFixed(2) + '%');

                    // 年限指数 及 医院数量
                    $('#count3-1').html(parseFloat(data.ageLimitList[1].curAgeLimitMeasure || 0).toFixed(2));
                    $('#yoy3-1').html(data.ageLimitList[1].hospitalCounts || 0);
                    // 设备数量 及 同比
                    $('#count3-2').html(data.ageLimitList[1].curCounts || 0);
                    $('#yoy3-2').html(parseFloat((data.ageLimitList[1].deviceCountsYoy) || 0).toFixed(2) + '%');
                    // 设备金额 及 同比
                    $('#count3-3').html(parseFloat((data.ageLimitList[1].curPrice / (CONST)) || 0).toFixed(2));
                    $('#count3-4').html(parseFloat((data.ageLimitList[1].devicePriceYoy) || 0).toFixed(2) + '%');

                    // 年限指数 及 医院数量
                    $('#count4-1').html(parseFloat(data.ageLimitList[2].curAgeLimitMeasure || 0).toFixed(2));
                    $('#yoy4-1').html(data.ageLimitList[2].hospitalCounts || 0);
                    // 设备数量 及 同比
                    $('#count4-2').html(data.ageLimitList[2].curCounts || 0);
                    $('#yoy4-2').html(parseFloat((data.ageLimitList[2].deviceCountsYoy) || 0).toFixed(2) + '%');
                    // 设备金额 及 同比
                    $('#count4-3').html(parseFloat((data.ageLimitList[2].curPrice / (CONST)) || 0).toFixed(2));
                    $('#count4-4').html(parseFloat((data.ageLimitList[2].devicePriceYoy) || 0).toFixed(2) + '%');

                    addArrowYoy('.totle');
                } else{
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            },
            failure: function () {
                flavrShowByTime(data.msg, null, "danger", false);
            }
        });
    }


    //医院top5
    function setUlHospital(sortord, index) {
        sort('desc', seriesPrice, ids, xAxis, seriesCount, seriesPriceYoy, seriesCountYoy, seriesAgeLimitMeasure, seriesDepreciationPrice);
        index = index ? index : 0;
        var len = xAxis.length;
        var x = 0,
            y = 0;
        if (index < 3) {
            x = 0;
        } else if(len - index < 3){
            x = (len - 5) > 0 ? (len - 5) : 0;
        } else {
            x = index - 2;
        }
        y = len > 5 ? x + 5 : len;
        var percent, count;
        $("#ul_hospital").html('');
        for (var i = x; i < y; i++) {
            percent = parseFloat(seriesAgeLimitMeasure[i]).toFixed(2);
            count = parseFloat(seriesPrice[i]).toFixed(2);
            $("#ul_hospital").append(
                '<li><a title="' + (i+1)+' ' +fullName[i] + '" onclick="query(\'hospital\',\''+ids[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxis[i] + '</span><em class="fl data_span_s">'
                + percent + '</em><em class="fr">'
                + count + '</em></a></li>');
        }
    }

    //设置与图表对应的表的内容
    function setUlType(sortord, index, tab) {
        index = index ? index : 0;
        var len = xAxisType.length;
        var x = 0,
            y = 0;
        if (index < 3) {
            x = 0;
        } else if(len - index < 3){
            x = (len - 5) > 0 ? (len - 5) : 0;
        } else {
            x = index - 2;
        }
        y = len > 5 ? x + 5 : len;
        var percent, count;
        $("#ul_type").html('');
        for (var i = x; i < y; i++) {
            percent = parseFloat(seriesAgeLimitMeasureType[i]).toFixed(2);
            count = parseFloat(seriesPriceType[i]).toFixed(2);
            $("#ul_type").append(
                '<li><a title="' + (i+1)+ ' ' + fullNameType[i] + '"' + ((tab && i == index) ? 'class="active"' : '') + ' onclick="query(\'type\',\'{modelName:'+idsType[i]+'}\')"><span class="fl data_span_f spanTitle">' + xAxisType[i] + '</span><em class="fl data_span_s">'
                + percent + '</em><em class="fr">'
                + count + '</em></a></li>'
            );
        }
    }

    //设备厂家top5
    function setUlBrand(sortord, index) {
        sort('desc', seriesPriceBrand, idsBrand, xAxisBrand, seriesCountBrand, seriesPriceYoyBrand, seriesCountYoyBrand, seriesAgeLimitMeasureBrand, seriesDepreciationPriceBrand);
        index = index ? index : 0;
        var len = xAxisBrand.length;
        var x = 0,
            y = 0;
        if (index < 3) {
            x = 0;
        } else if(len - index < 3){
            x = (len - 5) > 0 ? (len - 5) : 0;
        } else {
            x = index - 2;
        }
        y = len > 5 ? x + 5 : len;
        var percent, count;
        $("#ul_brand").html('');
        for (var i = x; i < y; i++) {
            percent = parseFloat(seriesAgeLimitMeasureBrand[i]).toFixed(2);
            count = parseFloat(seriesPriceBrand[i]).toFixed(2);
            $("#ul_brand").append(
                '<li><a title="' + (i+1)+ ' ' +fullNameBrand[i] + '" onclick="query(\'brand\',\''+idsBrand[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxisBrand[i] + '</span><em class="fl data_span_s">'
                + percent + '</em><em class="fr">'
                + count + '</em></a></li>');
        }
    }

    function setUlDevice(sortord, index) {
        var len = xAxisDevice.length;
        var x = 0,
            y = 0;
        if (index < 3) {
            x = 0;
        } else if(len - index < 3){
            x = (len - 5) > 0 ? (len - 5) : 0;
        } else {
            x = index - 2;
        }
        y = len > 5 ? x + 5 : len;
        var percent, count;
        $("#ul_device").html('');
        for (var i = x; i < y; i++) {
            percent = assets.allAssets.curPrice ? parseFloat((priceDevice[i] * 100 * CONST / assets.allAssets.curPrice)).toFixed(2) : '0.00';
            count = parseFloat(priceDevice[i]).toFixed(2);
            $("#ul_device").append(
                '<li><a title="'+ (i + 1) + ' ' + fullNameDevice[i] + '" onclick="query(\'device\',\''+idsDevice[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxisDevice[i] + '</span><em class="fl data_span_s">'
                + percent + '</em><em class="fr">'
                + count + '</em></a></li>'
            );
        }
    }

    //获取筛选条件参数
    function getParams() {
        loading(function () {

            hospitalId = $('.select_hospital').val() ? $('.select_hospital').val() : '';
            riskId = $('.select_risk').val() ? $('.select_risk').val() : '';
            typeId = $('.select_type').val() ? $('.select_type').val() : '';
            brandId = $('.select_brand').val() ? $('.select_brand').val() : '';
            year = $('.select_year').val() ? $('.select_year').val() : '';
            monthId = $('.select_month').val() ? $('.select_month').val() : '';
            enableYearStart = $('#enableYearStart').val() ? $('#enableYearStart').val() : '';
            enableYearEnd = $('#enableYearEnd').val() ? $('#enableYearEnd').val() : '';
            priceStart = $('#priceStart').val() ? $('#priceStart').val() * CONST : '';
            priceEnd = $('#priceEnd').val() ? $('#priceEnd').val() * CONST : '';
            ageLimitStart = $('#ageLimitStart').val() ? $('#ageLimitStart').val() : '';
            ageLimitEnd = $('#ageLimitEnd').val() ? $('#ageLimitEnd').val() : '';

            var oldParams = JSON.parse($.cookie('chooseValue') || '{}');
            $.cookie('chooseValue', JSON.stringify({
                hospitalId: hospitalId,
                riskId: riskId,
                typeId: GetQueryString('typeId') ? oldParams.typeId : typeId,
                brandId: GetQueryString('brandId') ? oldParams.brandId : brandId,
                year: year,
                monthId: monthId,
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd
            }), {path: '/'});

            queryAllAssets();
            queryChartsData();
            queryTypeTop5Data();
            queryBrandTop5Data();
            queryDeviceTop5Data();
        });
    }

    // 获取图表数据(医院)
    function queryChartsData(tableId) {
        ids = [];
        xAxis = [];
        series = [];
        seriesPrice = [];
        seriesCount = [];
        seriesPriceYoy = [];
        seriesCountYoy = [];
        seriesAgeLimitMeasure = [];
        seriesDepreciationPrice = [];
        fullName = [];
        hospitalJson = [];
        $.ajax({
            type: "POST",
            url: '<%=basePath%>/charts/hospital/model-index/department',
            data: {
              hospitalId: hspId,
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                riskId: riskId ? JSON.stringify(riskId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                modelName: modelName,
                brandId: brandId ? JSON.stringify(brandId) : '',
                year: year ? JSON.stringify(year) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd
            },
            dataType: "json",
            success: function (data) {
                if(data.ret == 1){
                    data.data = data.data || {list:[]};
                    hospitalJson = (data.data.list || []).sortByKey('curPrice').calTotal();
                    if(data.data.list){
                        for(var i = 0; i < data.data.list.length; i++){
                            if('${sessionScope.locale}'.indexOf('en') != -1) {
                                xAxis.push(data.data.list[i].enName || '');
                                fullName.push(data.data.list[i].fullEnName || '');
                            } else {
                                xAxis.push(data.data.list[i].name || '');
                                fullName.push(data.data.list[i].fullName || '');
                            }
                            seriesPrice.push(parseFloat((data.data.list[i].curPrice / CONST) || 0).toFixed(2));
                            seriesCount.push(data.data.list[i].curCounts || 0);
                            seriesPriceYoy.push(parseFloat(data.data.list[i].devicePriceYoy || 0).toFixed(2));
                            seriesCountYoy.push(parseFloat(data.data.list[i].deviceCountsYoy || 0).toFixed(2));
                            seriesAgeLimitMeasure.push(parseFloat(data.data.list[i].curAgeLimitMeasure || 0).toFixed(2));
                            seriesDepreciationPrice.push(parseFloat((data.data.list[i].curDepreciationPrice / CONST) || 0).toFixed(2));
                            ids.push(data.data.list[i].id || '');
                            series.push([parseFloat((data.data.list[i].curPrice / CONST) || 0).toFixed(2), (data.data.list[i].curCounts || 0), 50, data.data.list[i].name]);
                        }
                    }
                } else{
                    flavrShowByTime(data.msg, null, "danger", false);
                }
                setUlHospital('desc');
                if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') == 'hospital')) morehospitals();

                queryStatus.hospital = true;
                if (queryStatus.getStatus()) {
                    loading(true);
                    queryStatus.resetStatus();
                }
            },
            failure: function () {
                flavrShowByTime(data.msg, null, "danger", false);
            }
        })
    }

    // 获取图表数据(设备类型)
    function queryTypeTop5Data(tableId) {
        idsType = [];
        xAxisType = [];
        seriesType = [];
        seriesPriceType = [];
        seriesCountType = [];
        seriesPriceYoyType = [];
        seriesCountYoyType = [];
        seriesAgeLimitMeasureType = [];
        seriesDepreciationPriceType = [];
        fullNameType = [];
        typeJson = [];
        $.ajax({
            type: "POST",
            url: '<%=basePath%>/charts/hospital/model-index/model',
            data: {
              hospitalId: hspId,
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                riskId: riskId ? JSON.stringify(riskId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                brandId: brandId ? JSON.stringify(brandId) : '',
                year: year ? JSON.stringify(year) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd
            },
            dataType: "json",
            success: function (data) {
                if(data.ret){
                    data.data = data.data || {list:[]};
                    typeJson = (data.data.list || []).sortByKey('curPrice').calTotal();
                    if(data.data.list){
                        for(var i = 0; i < data.data.list.length; i++){
                            seriesPriceType.push(parseFloat((data.data.list[i].curPrice / CONST) || 0).toFixed(2));
                            seriesCountType.push(data.data.list[i].curCounts || 0);
                            seriesPriceYoyType.push(parseFloat(data.data.list[i].devicePriceYoy || 0).toFixed(2));
                            seriesCountYoyType.push(parseFloat(data.data.list[i].deviceCountsYoy || 0).toFixed(2));
                            seriesAgeLimitMeasureType.push(parseFloat(data.data.list[i].curAgeLimitMeasure || 0).toFixed(2));
                            seriesDepreciationPriceType.push(parseFloat((data.data.list[i].curDepreciationPrice / CONST) || 0).toFixed(2));
                            xAxisType.push(data.data.list[i].name || '');
                            idsType.push(data.data.list[i].id || '');
                            fullNameType.push(data.data.list[i].fullName || '');
                            seriesType.push([parseFloat((data.data.list[i].curPrice / CONST) || 0).toFixed(2), (data.data.list[i].curAgeLimitMeasure || 0), parseFloat(data.data.list[i].curAgeLimitMeasure || 0).toFixed(2), data.data.list[i].name]);
                        }
                        sort('desc', seriesPriceType, idsType, xAxisType, seriesCountType, seriesPriceYoyType, seriesCountYoyType, seriesAgeLimitMeasureType, seriesDepreciationPriceType, seriesType,fullNameType);

                        optionAgelimit.series[0].markLine.data[0].xAxis = parseFloat((data.data.avgPrice || 0) / CONST).toFixed(2);
                    }
                } else{
                    flavrShowByTime(data.msg, null, "danger", false);
                }
                optionAgelimit.series[0].markLine.data[1].yAxis = 1;
                optionAgelimit.series[0].data = seriesType;
                chart.setOption(optionAgelimit);

                setUlType('desc', 0);
                if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') == 'type')) moretypes();

                queryStatus.model = true;
                if (queryStatus.getStatus()) {
                    loading(true);
                    queryStatus.resetStatus();
                }
            },
            failure: function () {
                flavrShowByTime(data.msg, null, "danger", false);
            }
        })
    }

    function queryDeviceTop5Data(){
        idsDevice = [];
        xAxisDevice = [];
        modalNameDevice = [];
        departmentDevice = [];
        manufacturerDevice = [];
        snDevice = [];
        assetsNoDevice = [];
        priceDevice = [];
        depreciationPriceDevice = [];
        enableDateDevice = [];
        usedTimeDevice = [];
        ageLimitMeasureDevice = [];
        fullNameDevice = [];
        deviceJson = [];
        $.ajax({
            type: "POST",
            url: '<%=basePath%>/charts/hospital/model-index/assets',
            data: {
              hospitalId: hspId,
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                riskId: riskId ? JSON.stringify(riskId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                brandId: brandId ? JSON.stringify(brandId) : '',
                modelName: modelName,
                year: year ? JSON.stringify(year) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd
            },
            dataType: "json",
            success: function (data) {
                if(data.ret){
                    data.data = data.data || {list:[]};
                    deviceJson = (data.data.list || []).sortByKey('curPrice').calTotal();
                    if(data.data.list){
                        for(var i = 0; i < data.data.list.length; i++){
                            idsDevice.push(data.data.list[i].id || '');
                            xAxisDevice.push(data.data.list[i].name || '');
                            modalNameDevice.push(data.data.list[i].modalName || '');
                            departmentDevice.push(data.data.list[i].department || '');
                            manufacturerDevice.push(data.data.list[i].manufacturer || '');
                            snDevice.push(data.data.list[i].sn || '');
                            assetsNoDevice.push(data.data.list[i].assetsNo || '');
                            priceDevice.push(parseFloat((data.data.list[i].price / CONST) || 0).toFixed(2));
                            depreciationPriceDevice.push(parseFloat((data.data.list[i].depreciationPrice / CONST) || 0).toFixed(2));
                            enableDateDevice.push((data.data.list[i].enableDate || ''));
                            usedTimeDevice.push(parseFloat(data.data.list[i].usedTime || 0).toFixed(2));
                            ageLimitMeasureDevice.push(parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2));
                            fullNameDevice.push(data.data.list[i].name || '');
                        }
                    }
                    sort('desc', priceDevice, idsDevice, xAxisDevice, modalNameDevice, departmentDevice, manufacturerDevice, snDevice, assetsNoDevice, depreciationPriceDevice, enableDateDevice, usedTimeDevice, ageLimitMeasureDevice, fullNameDevice);
                } else{
                    flavrShowByTime(data.msg, null, "danger", false);
                }
                setUlDevice('desc', 0);
                if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') == 'device')) moredevices();

                queryStatus.assets = true;
                if (queryStatus.getStatus()) {
                    loading(true);
                    queryStatus.resetStatus();
                }
            },
            failure: function (data) {
                flavrShowByTime(data.msg, null, "danger", false);
            }
        })
    }

    // 通过设备型号查找设备(设备类型)
    function queryDeviceData(detailId) {
        if($(".detail-tr-"+detailId).hasClass("hide")){
            $(".detail-tr-"+detailId).removeClass("hide");
            $("#detail-"+detailId).removeClass("fa-plus");
            $("#detail-"+detailId).addClass("fa-minus");
            idsDevice = [];
            xAxisDevice = [];
            seriesDevice = [];
            seriesPriceDevice = [];
            seriesCountDevice = [];
            seriesPriceYoyDevice = [];
            seriesCountYoyDevice = [];
            seriesAgeLimitMeasureDevice = [];
            seriesDepreciationPriceDevice = [];
            $.ajax({
                type: "POST",
                url: '<%=basePath%>/charts/hospital/model-index/device',
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    modelName: modelName,
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd
                },
                dataType: "json",
                success: function (data) {
                    if(data.ret == 1){
                        data.data = data.data || {list:[]};
                        if(data.data.list.length){
                            var sb = new StringBuffer();
                            $("#detail-table-"+detailId).html('<tbody id="table_data"></tbody>');
                            sb.append("<thead><tr><th class='text-center'>#<p class='sort'></p></th>");
                            //表头
                            sb.append("<th class='text-right'><fmt:message key="share.table.head.sbmc"/><p class='sort'></p></th>");

                            //表格内容
                            sb.append("<th class='text-right'><fmt:message key="share.table.head.sbxh"/><p class='sort'></p></th>"
                                + "<th class='text-right'><fmt:message key="share.assets.ssks"/><p class='sort'></p></th>"
                                + "<th class='text-right'><fmt:message key="share.assets.snbh"/><p class='sort'></p></th>"
                                + "<th class='text-right'><fmt:message key="share.assets.zcbh"/><p class='sort'></p></th>"
                                + "<th class='text-left'><fmt:message key="share.table.head.sbcj"/></th>"
                                + "<th class='text-right'><fmt:message key="share.assets.sbje(wy)"/><p class='sort'></p></th>"
                                + "<th class='text-right'><fmt:message key="share.assets.zjje(wy)"/><p class='sort'></p></th>"
                                + "<th class='text-right'><fmt:message key="share.assets.sbqyrq"/><p class='sort'></p></th>"
                                + "<th class='text-right'><fmt:message key="share.assets.ysysj(n)"/><p class='sort'></p></th>"
                                + "<th class='text-right'><fmt:message key="share.assets.nxzs"/><p class='sort'></p></th>"
                                + "</tr></thead>");
                            $("#detail-table-"+detailId).prepend(sb.toString());
                            for (var i = 0; i < data.data.list.length; i++) {
                                $("#detail-table-"+detailId+" #table_data").append("<tr>"
                                    + "<td class='text-center'>" + (i + 1) + "</td>"
                                    + "<td class='spanTitle' onclick=query(\"device\",\""+data.data.list[i].id+"\") title='" + (data.data.list[i].name || '') + "'>" + (data.data.list[i].name || '') + "</td>"
                                    + "<td class='text-right'>" + (data.data.list[i].modalName || '') + "</td>"
                                    + "<td class='text-right'>" + (data.data.list[i].department || '') + "</td>"
                                    + "<td class='text-right'>" + (data.data.list[i].sn || '') + "</td>"
                                    + "<td class='text-right'>" + (data.data.list[i].assetsNo || '') + "</td>"
                                    + "<td class='text-right'>" + (data.data.list[i].manufacturer || '') + "</td>"
                                    + "<td class='text-right'>" + parseFloat((data.data.list[i].price / CONST) || 0).toFixed(2) + "</td>"
                                    + "<td class='text-right'>" + parseFloat((data.data.list[i].depreciationPrice / CONST) || 0).toFixed(2) + "</td>"
                                    + "<td class='text-right'>" + (data.data.list[i].enableDate || '') + "</td>"
                                    + "<td class='text-right'>" + parseFloat(data.data.list[i].usedTime || 0).toFixed(2) + "</td>"
                                    + "<td class='text-right'>" + parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2) + "</td>"
                                    + "</tr>");
                            }

                        }else{
                            $("#detail-table-"+detailId).html('<p><fmt:message key="share.talbe.myxgjl"/></p>');
                        }
                    } else{
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }else{
             $(".detail-tr-"+detailId).addClass("hide");
             $("#detail-"+detailId).addClass("fa-plus");
             $("#detail-"+detailId).removeClass("fa-minus");
        }
    }

    function queryDeviceTable(param) {
        $.ajax({
            type: "POST",
            url: '<%=basePath%>/charts/hospital/department-index/device',
            data: $.extend({}, {
              hospitalId: hspId,
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                riskId: riskId ? JSON.stringify(riskId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                brandId: brandId ? JSON.stringify(brandId) : '',
                year: year ? JSON.stringify(year) : '',
                monthId: monthId ? JSON.stringify(monthId) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd
            }, param),
            dataType: "json",
            success: function (data) {
                if(data.ret){
                    data.data = data.data || {list:[]};
                    if(data.data.list.length){
                        var sb = new StringBuffer();
                        sb.append("<tr><th class='text-center'>#</th>");
                        //表头
                        sb.append("<th class='text-left'><fmt:message key="share.table.head.sbmc"/></th>");
                        //表格内容
                        sb.append("<th class='text-left'><fmt:message key="share.assets.sbxh"/></th>"
                            + "<th class='text-left'><fmt:message key="share.title.sblx"/></th>"
                            + "<th class='text-left'><fmt:message key="share.assets.ssks"/></th>"
                            + "<th class='text-left'><fmt:message key="share.assets.snbh"/></th>"
                            + "<th class='text-left'><fmt:message key="share.assets.zcbh"/></th>"
                            + "<th class='text-left'><fmt:message key="share.table.head.sbcj"/></th>"
                            + "<th class='text-right'><fmt:message key="share.assets.sbje(wy)"/></th>"
                            + "<th class='text-right'><fmt:message key="share.assets.zjje(wy)"/></th>"
                            + "<th class='text-right'><fmt:message key="share.assets.sbqyrq"/></th>"
                            + "<th class='text-right'><fmt:message key="share.assets.ysysj(n)"/></th>"
                            + "<th class='text-right'><fmt:message key="share.assets.nxzs"/></th>"
                            + "</tr>");
                        var str = '';
                        for (var i = 0; i < data.data.list.length; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick=query(\"device\",\""+data.data.list[i].id+"\") title='" + (data.data.list[i].name || '') + "'>" + (data.data.list[i].name || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].modalName || '') + "</td>"
                                + "<td class='no-cal'>" + fixStr(data.data.list[i].firstTypeName) + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].department || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].sn || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].assetsNo || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].manufacturer || '') + "</td>"
                                + "<td class='total-1 text-right'>" + parseFloat((data.data.list[i].price / CONST) || 0).toFixed(2) + "</td>"
                                + "<td class='total-2 text-right'>" + parseFloat((data.data.list[i].depreciationPrice / CONST) || 0).toFixed(2) + "</td>"
                                + "<td class='no-cal text-right'>" + (data.data.list[i].enableDate || '') + "</td>"
                                + "<td class='avg-1 text-right'>" + parseFloat(data.data.list[i].usedTime || 0).toFixed(2) + "</td>"
                                + "<td class='avg-2 text-right'>" + parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2) + "</td>"
                                + "</tr>";
                        }
                        addAssetModal('<fmt:message key="share.talbe.sbxq"/>', sb.toString(), str);
                    }
                } else{
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            },
            failure: function () {
                flavrShowByTime(data.msg, null, "danger", false);
            }
        })
    }

    // 获取图表数据(设备厂家)
    function queryBrandTop5Data(tableId) {
        idsBrand = [];
        xAxisBrand = [];
        seriesBrand = [];
        seriesPriceBrand = [];
        seriesCountBrand = [];
        seriesPriceYoyBrand = [];
        seriesCountYoyBrand = [];
        seriesAgeLimitMeasureBrand = [];
        seriesDepreciationPriceBrand = [];
        fullNameBrand = [];
        brandJson = [];
        $.ajax({
            type: "POST",
            url: '<%=basePath%>/charts/hospital/model-index/brand',
            data: {
              hospitalId: hspId,
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                riskId: riskId ? JSON.stringify(riskId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                modelName: modelName || '',
                brandId: brandId ? JSON.stringify(brandId) : '',
                year: year ? JSON.stringify(year) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd
            },
            dataType: "json",
            success: function (data) {
                if(data.ret == 1){
                    data.data = data.data || {list:[]};
                    brandJson = (data.data.list || []).sortByKey('curPrice').calTotal();
                    if(data.data.list){
                        for(var i = 0; i < data.data.list.length; i++){
                            seriesPriceBrand.push(parseFloat((data.data.list[i].curPrice / CONST) || 0).toFixed(2));
                            seriesCountBrand.push(data.data.list[i].curCounts || 0);
                            seriesPriceYoyBrand.push(parseFloat(data.data.list[i].devicePriceYoy || 0).toFixed(2));
                            seriesCountYoyBrand.push(parseFloat(data.data.list[i].deviceCountsYoy || 0).toFixed(2));
                            seriesAgeLimitMeasureBrand.push(parseFloat(data.data.list[i].curAgeLimitMeasure || 0).toFixed(2));
                            seriesDepreciationPriceBrand.push(parseFloat((data.data.list[i].curDepreciationPrice / CONST) || 0).toFixed(2));
                            xAxisBrand.push(data.data.list[i].name || '');
                            idsBrand.push(data.data.list[i].id || '');
                            fullNameBrand.push(data.data.list[i].fullName || '');
                        }
                    }
                } else{
                    flavrShowByTime(data.msg, null, "danger", false);
                }
                setUlBrand('desc', 0);
                if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') == 'brand')) morebrands();

                queryStatus.brand = true;
                if (queryStatus.getStatus()) {
                    loading(true);
                    queryStatus.resetStatus();
                }
            },
            failure: function () {
                flavrShowByTime(data.msg, null, "danger", false);
            }
        })
    }

    $('#morehospitals').click(morehospitals);
    function morehospitals(param){
        loading(function () {
            param = $.extend({}, {
                id: '',
                dataJson: hospitalJson,
                modal: 'modal',
                table: 'tblSort'
            }, param);
            var modal = $('#modal').attr('modal', 'hospital');
            var sb = new StringBuffer();
            var table = $("#tblSort").html('<tbody></tbody>');
            var tbody = table.find('tbody');
            var data = hospitalJson;
            sb.append("<thead><tr><th class='text-center'>#</th>");
            //表头
            sb.append("<th class='text-center'><fmt:message key="share.table.head.yyks"/></th>");

            //表格内容
            sb.append("<th class='text-center'><fmt:message key="index.table.sbje(wy)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.ncsbje(wy)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.sbsl(t)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.xzsbsl(t)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.bfsl(t)"/></th>"
                + "<th class='text-center'><fmt:message key="index.table.sbjetb(%)"/></th>"
                + "<th class='text-center'><fmt:message key="index.table.sbsltb(%)"/></th>"
                + "<th class='text-center'><fmt:message key="index.table.zjje(wy)"/></th>"
                + "<th class='text-center'><fmt:message key="index.table.nxzs"/></th>"
                + "</tr></thead>");
            table.prepend(sb.toString());
            groupLoading(data.length, function (min, max) {
                var str = '';
                for (var i = min; i < max; i++) {
                    str += "<tr>"
                        + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                        + "<td class='no-cal text-left spanTitle' onclick='query(\"hospital\",\"" + ids[i] + "\")'>" + xAxis[i] + "</td>"
                        + "<td class='total-1 text-right'>" + parseFloat(seriesPrice[i]).toFixed(2) + "</td>"
                        + "<td class='total-4 text-right'>" + parseFloat(data[i].curBeginPrice / CONST || 0).toFixed(2) + "</td>"
                        + "<td class='total-2 text-right" + (seriesCount[i] ? ' spanTitle' : '') + "' onclick=\"query('hospital','{" + (param.id ? 'year:' + param.id + ',' : '') + "departmentId:[" + ids[i] + "]}','" + seriesCount[i] + "')\">" + (seriesCount[i] || 0) + "</td>"
                        + "<td class='total-5 text-right" + (data[i].curNewlyCounts ? ' spanTitle' : '') + "' onclick=\"query('newly','{" + (param.id ? 'year:' + param.id + ',' : '') + "departmentId:[" + data[i].id + "]}','" + data[i].curNewlyCounts + "')\">" + (data[i].curNewlyCounts || 0) + "</td>"
                        + "<td class='total-6 text-right" + (data[i].curScrapCounts ? ' spanTitle' : '') + "' onclick=\"query('scrap','{" + (param.id ? 'year:' + param.id + ',' : '') + "departmentId:[" + data[i].id + "]}','" + data[i].curScrapCounts + "')\">" + (data[i].curScrapCounts || 0) + "</td>"
                        + "<td class='avg-3 text-right yoy'>" + parseFloat(seriesPriceYoy[i]).toFixed(2) + "</td>"
                        + "<td class='avg-4 text-right yoy'>" + parseFloat(seriesCountYoy[i]).toFixed(2) + "</td>"
                        + "<td class='total-7 text-right'>" + parseFloat(seriesDepreciationPrice[i]).toFixed(2) + "</td>"
                        + "<td class='avg-6 text-right'>" + parseFloat(seriesAgeLimitMeasure[i]).toFixed(2) + "</td>"
                        + "</tr>";
                }
                tbody.append(str);
                if (max === data.length)
                    calTableData('tblSort', true);
            });
            modal.iziModal('setTitle', '<fmt:message key="charts.title.yyksfb"/>');
            modal.iziModal('open', this);
            loading(true);
        });
    }


    $('#moredetail ,#moretypes').click(moretypes);
    function moretypes(param){
        loading(function () {
            param = $.extend({}, {
                id: '',
                dataJson: typeJson,
                modal: 'modal',
                table: 'tblSort'
            }, param);
            var data = $.extend([], param.dataJson);
            var modal = $('#' + param.modal);
            var table = $('#' + param.table);
            modal.attr('modal', 'type');
            var sb = new StringBuffer();
            table.html('<tbody></tbody>');
            tbody = table.find('tbody');
            sb.append("<thead><tr><th class='text-center'>#</th>");
            //表头
            sb.append("<th class='text-left'><fmt:message key="share.table.head.sbxh"/></th>");

            //表格内容
            sb.append("<th class='text-right'><fmt:message key="index.table.sbje(wy)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.ncsbje(wy)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.sbsl(t)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.xzsbsl(t)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.bfsl(t)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.sbjetb(%)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.sbsltb(%)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.zjje(wy)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.nxzs"/></th>"
                + "</tr></thead>");
            table.prepend(sb.toString());
            groupLoading(data.length, function (min, max) {
                var str = '';
                for (var i = min; i < max; i++) {
                    str += "<tr>"
                        + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                        + "<td class='no-cal spanTitle' onclick='query(\"type\", \"{modelName:" + data[i].id + "}\")'>" + data[i].name + "</td>"
                        + "<td class='total-1 text-right'>" + parseFloat(data[i].curPrice / CONST || 0).toFixed(2) + "</td>"
                        + "<td class='total-4 text-right'>" + parseFloat(data[i].curBeginPrice / CONST || 0).toFixed(2) + "</td>"
                        + "<td class='total-2 text-right" + (data[i].curCounts ? ' spanTitle' : '') + "' onclick=\"query('hospital','{" + (param.id ? 'year:' + param.id + ',' : '') + "modelName:" + data[i].id + "}','" + data[i].curCounts + "')\">" + (data[i].curCounts || 0) + "</td>"
                        + "<td class='total-5 text-right" + (data[i].curNewlyCounts ? ' spanTitle' : '') + "' onclick=\"query('newly','{" + (param.id ? 'year:' + param.id + ',' : '') + "modelName:" + data[i].id + "}','" + data[i].curNewlyCounts + "')\">" + (data[i].curNewlyCounts || 0) + "</td>"
                        + "<td class='total-6 text-right" + (data[i].curScrapCounts ? ' spanTitle' : '') + "' onclick=\"query('scrap','{" + (param.id ? 'year:' + param.id + ',' : '') + "modelName:" + data[i].id + "}','" + data[i].curScrapCounts + "')\">" + (data[i].curScrapCounts || 0) + "</td>"
                        + "<td class='avg-3 text-right yoy'>" + parseFloat(data[i].devicePriceYoy || 0).toFixed(2) + "</td>"
                        + "<td class='avg-4 text-right yoy'>" + parseFloat(data[i].deviceCountsYoy || 0).toFixed(2) + "</td>"
                        + "<td class='total-5 text-right'>" + parseFloat(data[i].curDepreciationPrice / CONST || 0).toFixed(2) + "</td>"
                        + "<td class='avg-1 text-right '>" + parseFloat(data[i].curAgeLimitMeasure).toFixed(2) + "</td>"
                        + "</tr>";
                }
                tbody.append(str);
                if (max === data.length)
                    calTableData(param.table, true);
            });
            modal.iziModal('setTitle', '<fmt:message key="charts.title.sbxhfb"/>');
            modal.iziModal('open', this);
            loading(true);
        });
    }

    $('#morebrand').click(morebrands);
    function morebrands(){
        loading(function () {
            var modal = $('#modal').attr('modal', 'brand');
            var sb = new StringBuffer();
            var table = $("#tblSort").html('<tbody></tbody>');
            var tbody = table.find('tbody');
            var data = brandJson;
            sb.append("<thead><tr><th class='text-center'>#</th>");
            //表头
            sb.append("<th class='text-left'><fmt:message key="share.table.head.sbcj"/></th>");

            //表格内容
            sb.append("<th class='text-right'><fmt:message key="index.table.sbje(wy)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.ncsbje(wy)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.sbsl(t)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.xzsbsl(t)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.bfsl(t)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.sbjetb(%)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.sbsltb(%)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.zjje(wy)"/></th>"
                + "<th class='text-right'><fmt:message key="index.table.nxzs"/></th>"
                + "</tr></thead>");
            table.prepend(sb.toString());
            groupLoading(data.length, function (min, max) {
                var str = '';
                for (var i = min; i < max; i++) {
                    str += "<tr>"
                        + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                        + "<td class='no-cal text-left spanTitle' onclick='query(\"brand\",\"" + idsBrand[i] + "\")'>" + xAxisBrand[i] + "</td>"
                        + "<td class='total-1 text-right'>" + parseFloat(seriesPriceBrand[i]).toFixed(2) + "</td>"
                        + "<td class='total-4 text-right'>" + parseFloat(data[i].curBeginPrice / CONST || 0).toFixed(2) + "</td>"
                        + "<td class='total-2 text-right" + (data[i].curCounts ? ' spanTitle' : '') + "' onclick=\"query('hospital','{brandId:[" + data[i].id + "]}','" + data[i].curCounts + "')\">" + (data[i].curCounts || 0) + "</td>"
                        + "<td class='total-5 text-right" + (data[i].curNewlyCounts ? ' spanTitle' : '') + "' onclick=\"query('newly','{brandId:[" + data[i].id + "]}','" + data[i].curNewlyCounts + "')\">" + (data[i].curNewlyCounts || 0) + "</td>"
                        + "<td class='total-6 text-right" + (data[i].curScrapCounts ? ' spanTitle' : '') + "' onclick=\"query('scrap','{brandId:[" + data[i].id + "]}','" + data[i].curScrapCounts + "')\">" + (data[i].curScrapCounts || 0) + "</td>"
                        + "<td class='avg-3 text-right yoy'>" + parseFloat(seriesPriceYoyBrand[i]).toFixed(2) + "</td>"
                        + "<td class='avg-4 text-right yoy'>" + parseFloat(seriesCountYoyBrand[i]).toFixed(2) + "</td>"
                        + "<td class='total-7 text-right'>" + parseFloat(seriesDepreciationPriceBrand[i]).toFixed(2) + "</td>"
                        + "<td class='avg-6 text-right'>" + parseFloat(seriesAgeLimitMeasureBrand[i]).toFixed(2) + "</td>"
                        + "</tr>";
                }
                tbody.append(str);
                if (max === data.length)
                    calTableData("tblSort", true);
            });
            modal.iziModal('setTitle', '<fmt:message key="share.table.title.sbcjfbxq"/>');
            modal.iziModal('open', this);
            loading(true);
        });
    }

    $('#moredevices').click(moredevices);
    function moredevices(){
        loading(function () {
            var modal = $('#modal').attr('modal', 'device');
            var sb = new StringBuffer();
            var table = $("#tblSort").html('<tbody></tbody>');
            var tbody = table.find('tbody');
            var data = deviceJson;
            sb.append("<thead><tr><th class='text-center' key='' value='<fmt:message key="share.table.tail.zj"/>'>#</th>");
            //表头
            sb.append("<th class='text-left' key='name'><fmt:message key="share.table.head.sbmc"/></th>");

            //表格内容
            sb.append("<th class='text-left' key='modalName'><fmt:message key="share.table.head.sbxh"/></th>"
                + "<th class='text-left' key='firstTypeName'><fmt:message key="share.title.sblx"/></th>"
                + "<th class='text-left' key='departmentName'><fmt:message key="share.assets.ssks"/></th>"
                + "<th class='text-left' key='manufacturer'><fmt:message key="share.table.head.sbcj"/></th>"
                + "<th class='text-left' key='sn' value=''><fmt:message key="share.assets.snbh"/></th>"
                + "<th class='text-left' key='assetsNo' value=''><fmt:message key="share.assets.zcbh"/></th>"
                + "<th class='text-left' key='enableDate' value=''><fmt:message key="share.assets.sbqyrq"/></th>"
                + "<th class='text-right' key='price' value='" + fix2(data[-1].price / CONST) + "'><fmt:message key="share.assets.sbje(wy)"/></th>"
                + "<th class='text-right' key='depreciationPrice' value='" + fix2(data[-1].depreciationPrice / CONST) + "'><fmt:message key="share.assets.zjje(wy)"/></th>"
                + "<th class='text-right' key='usedTime' value='" + fix2(data[-1].usedTime / data.length) + "'><fmt:message key="share.assets.ysysj(n)"/></th>"
                + "<th class='text-right' key='ageLimitMeasure' value='" + fix2(data[-1].ageLimitMeasure / data.length) + "'><fmt:message key="share.assets.nxzs"/></th>"
                + "</tr></thead>");
            table.prepend(sb.toString());
            groupLoading(data.length, function (min, max) {
                var str = '';
                for (var i = min; i < max; i++) {
                    str += "<tr>"
                        + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                        + "<td class='no-cal spanTitle' onclick='query(\"device\",\"" + idsDevice[i] + "\")' title='" + xAxisDevice[i] + "'>" + xAxisDevice[i] + "</td>"
                        + "<td class='no-cal text-left'>" + modalNameDevice[i] + "</td>"
                        + "<td class='no-cal'>" + fixStr(data[i].firstTypeName) + "</td>"
                        + "<td class='no-cal text-left'>" + departmentDevice[i] + "</td>"
                        + "<td class='no-cal' title='" + manufacturerDevice[i] + "'>" + manufacturerDevice[i] + "</td>"
                        + "<td class='no-cal text-left'>" + snDevice[i] + "</td>"
                        + "<td class='no-cal text-left'>" + assetsNoDevice[i] + "</td>"
                        + "<td class='no-cal text-left'>" + enableDateDevice[i] + "</td>"
                        + "<td class='total-1 text-right'>" + priceDevice[i] + "</td>"
                        + "<td class='total-2 text-right'>" + depreciationPriceDevice[i] + "</td>"
                        + "<td class='total-3 text-right'>" + usedTimeDevice[i] + "</td>"
                        + "<td class='avg-4 text-right'>" + ageLimitMeasureDevice[i] + "</td>"
                        + "</tr>";
                }
                tbody.append(str);
                if (max === data.length)
                    calTableData('tblSort', true);
            });
            modal.iziModal('setTitle', '<fmt:message key="share.table.title.sbfbxq"/>');
            modal.iziModal('open', this);
            loading(true);
        });
    }

    function query(tag, id, detailId){
        if(detailId) {
            if(tag === 'hospital') {
                queryDeviceTable($.extend({}, string2json(id)));
            } else if (tag === 'newly') {
                queryAssets($.extend({}, string2json(id), {assetsTag: 1}));
            } else if (tag === 'scrap') {
                queryAssets($.extend({}, string2json(id), {assetsTag: 2}));
            }
        } else {
            if (tag === 'type') {
                queryDeviceTable($.extend({}, string2json(id)));
            } else if (tag == 'hospital') {
                location.href = '<%=basePath%>/charts/hospital/type-index/page?typeId=' + GetQueryString('typeId') + '&departmentId=' + id + '&hospitalId=' + hspId;
            } else if (tag == 'brand') {
                location.href = '<%=basePath%>/charts/hospital/type-brand/page?typeId=' + GetQueryString('typeId') + '&brandId=' + id + '&hospitalId=' + hspId;
            } else if (tag == 'device' && deviceRedirect) {
                window.open('<%=basePath%>/charts/overview/assets/page?deviceId=' + id);
            }
        }
    }

    //设备年限气泡图
    var optionAgelimit = {
        color: ['#31860f'],
        backgroundColor: '#373945',
        tooltip: {
            trigger: 'item',
            textStyle: {
                fontSize: 0.28 * rem
            },
            formatter: function (a) {
                if(a.componentType == "markLine"){
                    return a.name + ':' + a.value;
                } else{
                    var index = a.dataIndex;
                    return xAxisType[index] + '<br/>'
                        + '<fmt:message key="index.overview.yyks.sbje"/>：' + seriesPriceType[index] + '<fmt:message key="share.unit.wanyuan"/><br/>'
                        + '<fmt:message key="index.overview.yyks.sbsl"/>：' + seriesCountType[index] + '<fmt:message key="share.unit.tai"/><br/>'
                        + '<fmt:message key="charts.index.sbjetb"/>：' + seriesPriceYoyType[index] + '%<br/>'
                        + '<fmt:message key="charts.index.sbsltb"/>：' + seriesCountYoyType[index] + '%<br/>'
                        + '<fmt:message key="index.table.nxzs"/>：' + seriesAgeLimitMeasureType[index];
                }
            }
        },
        dataZoom: [{
            type: 'inside',
            xAxisIndex: [0],
            start: 0,
            end: 100
        },
            {
                type: 'inside',
                yAxisIndex: [0],
                start: 0,
                end: 100
            }
        ],
        grid: {
            top: 1.2 * rem,
            left: 0.4 * rem,
            right: 2.4 * rem,
            bottom: 0.8 * rem,
            containLabel: true
        },
        xAxis: {
            name: '<fmt:message key="index.overview.yyks.sbje"/>：<fmt:message key="share.unit.wanyuan"/>',
            type: 'value',
            nameTextStyle: {
                color: '#AAA',
                fontSize: 0.28 * rem
            },
            axisLabel: {
                show: true,
                fontSize: 0.28 * rem,
                textStyle: {
                    color: '#fff'
                }
            },
            splitLine: {
                show: false,
                lineStyle: {
                    color: '#f00',
                    type: 'dashed'
                }
            },
            axisLine: {
                lineStyle: {
                    color: '#fff'
                }
            },
            axisTick: {
                lineStyle: {
                    color: '#fff'
                }
            }
        },
        yAxis: [{
            name: '<fmt:message key="index.table.nxzs"/>',
            type: 'value',
            nameTextStyle: {
                color: '#AAA',
                fontSize: 0.28 * rem
            },
            axisLabel: {
                show: true,
                fontSize: 0.28 * rem,
                textStyle: {
                    color: '#fff'
                }
            },
            splitLine: {
                show: false,
                lineStyle: {
                    color: '#f00',
                    type: 'dashed'
                }
            },
            axisLine: {
                lineStyle: {
                    color: '#fff'
                }
            },
            axisTick: {
                lineStyle: {
                    color: '#fff'
                }
            }
        }],
        series: [{
            type: 'scatter',
            data: [],
            symbolSize: function (data) {
                var max = seriesAgeLimitMeasureType.max(),
                    min = seriesAgeLimitMeasureType.min(),
                    range = max - min;
                if (data[2] === 0) return 0;
                if (range == 0) return 35;
                return data[2] === 0 ? 0 : (30 * (data[2] - min) / range + 20);
            },
            markLine: {
                lineStyle: {
                    normal: {
                        color: '#f00',
                        type: 'dashed',
                        opacity: 0.4
                    }
                },
                data: [
                    {type: 'average', name: '<fmt:message key="charts.avg.sbjepjz(wy)"/>',valueIndex: 0,xAxis: null},
                    {type: 'average', name: '<fmt:message key="charts.avg.nxzsbzx"/>',valueIndex: 1,yAxis: null}
                ]
            }
        }]
    };
</script>
</body>
</fmt:bundle>
</html>
